package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class OISDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream fis = new FileInputStream("person.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);

        Object obj =  ois.readObject();
        Person p = (Person) obj;
        System.out.println(p);
        System.out.println("读入完毕");
        ois.close();
    }
}
